package com.sec.android.app.myfiles.widget.listview;

import android.content.Context;
import android.content.res.Resources;
import android.view.View;
import android.widget.GridView;

import com.sec.android.app.myfiles.R;
import com.sec.android.app.myfiles.info.AppFeatures;
import com.sec.android.app.myfiles.widget.listview.listdecorator.AbsListDecorator;

public class RecentViewImp extends GridViewImp {

    RecentViewImp(Context context, View parentView, AbsListDecorator decorator) {
        super(context, parentView, decorator);
    }

    @Override
    protected int _getItemLayoutId() {
        int ret = super._getItemLayoutId();
        return ret;
    }

    @Override
    protected void _refreshLayout() {

        Resources res = mContext.getResources();

        int verticalSpacing = (int) res.getDimension(R.dimen.grid_view_spacing_vertical);
        int horizontalSpacing = (int) res.getDimension(R.dimen.grid_view_spacing_horizontal);
        int columnWidth = (int) res.getDimension(R.dimen.list_item_grid_size);
        int sidePadding = (int) res.getDimension(R.dimen.grid_view_padding_horizontal);
        int paddingTop = (int) res.getDimension(R.dimen.grid_view_padding_top);
        if (AppFeatures.isTabletUIMode()) {
            sidePadding = (int) res.getDimension(R.dimen.tablet_grid_recent_padding);
            paddingTop = (int) res.getDimension(R.dimen.tablet_grid_recent_padding);
        }
        int paddingBottom = (int) res.getDimension(R.dimen.grid_view_padding_bottom);

        ((GridView) mListView).setColumnWidth(columnWidth);
        ((GridView) mListView).setVerticalSpacing(verticalSpacing);
        ((GridView) mListView).setHorizontalSpacing(horizontalSpacing);
        mListView.setPadding(sidePadding, paddingTop, sidePadding, paddingBottom);
    }
}
